import request from '@/api/request';

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const vodConfigPageApi = query => {
    return request({
        url: '/api/setup/vod/config/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const vodConfigDetailApi = query => {
    return request({
        url: '/api/setup/vod/config/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const vodConfigSaveApi = query => {
    return request({
        url: '/api/setup/vod/config/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const vodConfigEditApi = query => {
    return request({
        url: '/api/setup/vod/config/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑状态
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const vodConfigEditStatusApi = query => {
    return request({
        url: '/api/setup/vod/config/editStatus',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const vodConfigRemoveApi = query => {
    return request({
        url: '/api/setup/vod/config/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};

/**
 * 导出模版
 * @returns 返回Promise对象
 */
export const vodConfigExportTemplateApi = () => {
    return request({
        url: '/api/setup/vod/config/exportTemplate',
        method: 'get',
        responseType: 'blob',
        isLoading: true
    });
};

/**
 * 导入
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const vodConfigImportByTemplateApi = query => {
    return request({
        url: '/api/setup/vod/config/importByTemplate',
        method: 'post',
        data: query,
        responseType: 'blob',
        isLoading: true
    });
};
